<template>
  <teleport to="#selfLoading">
    <div class="outer">
      <H3 class="inner"> loading....</H3>
    </div>
  </teleport>
</template>

<script>
import { onUnmounted } from "vue";

export default {
  name: "SelfLoading",
  props: {
    text: {
      type: String,
      Required: false,
    },
  },
  components: {},
  setup() {
    const node = document.createElement("div");
    node.id = "selfLoading";
    document.body.appendChild(node);
    onUnmounted(() => {
      () => {
        document.removeChild(node);
      };
    });
    return {};
  },
};
</script>

<style lang="scss" scoped>
.outer {
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100%;
  background-color: pink;
}
.inner {
}
</style>
